<template>
  <div class="home">
  </div>
</template>

<script>
// axios配置
// 配置的地方
//1.全局配置 axios.defaults.baseURl = 'api'
//2.实例配置 axios.create({})
//3.请求配置 innstance.get('/cache/get',{timeout:3000})
import axios from 'axios'
export default {
  name: 'axios3-2',
  created(){
    let innstance =axios.create({
      baseURL:' http://localhost:8080/api',//基本地址
      timeout:1000,//请求超时时长
      url:'/cache/get', //请求路径
      method:'get',
      headers:{
        token:'uuid'
      },
      params:{},//请求参数凭借到url
      data:{},//请求参数放在请求体
    })
    
    innstance.get('/cache/get',{params:{key:12}})
  }
}
</script>
